/********************************************************************************
do-file to replicate tables in:
	Chacon, Mario and Jeff Jensen. 2019. "Democratization, De Facto Power, and Taxation: 
	Evidence from Military Occupation during Reconstruction" World Politics 

data file needed: Dataset_2 (Panel Political Violence) 
*/

clear all 
set more off

**Set Working Directory 
*cd "C:\****\ Replication Files (Chacon & Jensen, WP 2019)\Datasets\"

use Dataset_2, clear 

*** Table 5. Political Violence and Occupation (Panel) 
* c1-c2 (Full Sample) 
xtreg d_killed_ d_occup_ , fe r  
outreg2 using table7.xls,  keep(d_occup_) dec(3) noast replace 

xtreg d_killed_ d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 , fe r
outreg2 using table7.xls,  keep(d_occup_) dec(3) noast 

* c3 (Sample below state-specific black share median) 
xtreg d_killed_ d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 if d_hbs==0, fe r
outreg2 using table7.xls,  keep(d_occup_) dec(3) noast

* c4 (Sample above state-specific black share median)
xtreg d_killed_ d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 if d_hbs==1, fe r
outreg2 using table7.xls,  keep(d_occup_) dec(3) noast

* c5-c6 (Full Sample, lagged model) 
xtreg d_killed_ l.d_occup_ , fe r  
outreg2 using table7.xls,  keep(l.d_occup_) dec(3) noast 

xtreg d_killed_ l.d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 , fe r
outreg2 using table7.xls,  keep(l.d_occup_) dec(3) noast 

* c7 (Sample below state-specific black share median) 
xtreg d_killed_ l.d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 if d_hbs==0, fe r
outreg2 using table7.xls,  keep(l.d_occup_) dec(3) noast

* c8 (Sample above state-specific black share median) 
xtreg d_killed_ l.d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 if d_hbs==1, fe r
outreg2 using table7.xls,  keep(l.d_occup_) dec(3) noast

*** Online Appendix Table 10. Robustness Tests 

** Falsification (c1-c3) 
xtreg d_killed_ f.d_occup_ , fe r  
outreg2 using table7A.xls,  keep(f.d_occup_) dec(3) noast replace 

xtreg d_killed_ f.d_occup_  yr2-yr7 , fe r
outreg2 using table7A.xls,  keep(f.d_occup_) dec(3) noast 

xtreg d_killed_ f.d_occup_ i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 , fe r
outreg2 using table7A.xls,  keep(f.d_occup_) dec(3) noast 

** Models with Departure Indicator (c4-c6) 
gen depart=.
replace depart=1 if l.d_occup_==1 & d_occup_==0 
replace depart=0 if l.d_occup_==1 & d_occup_==1 

xtreg d_killed_ depart, fe r  
outreg2 using table7A.xls,  keep(depart) dec(3) noast 

xtreg d_killed_ depart yr1-yr6, fe r  
outreg2 using table7A.xls,  keep(depart) dec(3) noast 

xtreg killed_ depart i_black_sh_1860_yr2-i_lnFarValRPc1860_yr7 yr2-yr7 , fe r
outreg2 using table7A.xls,  keep(depart) dec(3) noast 
